/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * <p>Project: jse2303 - List5
 * <p>Powered by webrx On 2023-07-19 11:30:29
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class List5 {
    public static void main(String[] args) {
        //List.of();
        List<Student> list = new ArrayList<>(List.of(
                new Student(1, "李四1", 30),
                new Student(20, "李四2", 20),
                new Student(3, "李四3", 90),
                new Student(4, "李四4", 60)
        ));
        System.out.println(list);
        System.out.println("-------------------");

        //List.sort()  Collections.sort()
        //Collections.shuffle();
        //Collections.reverse();
        //list.sort((a, b) -> b.getScore() - a.getScore());

        Collections.sort(list);
        for (Student st : list) {
            System.out.println(st);
        }
    }
}
